/*
** user_bool_choise.c for raytracer in /home/duplomt/work/bicycle-raytracer
**
** Made by Thomas Duplomb
** Login   <duplomt@epitech.net>
**
** Started on  Wed Jun  8 15:37:43 2011 Thomas Duplomb
** Last update Wed Jun  8 15:56:47 2011 Thomas Duplomb
*/

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include "raytracer.h"

t_bool
user_bool_choise(char *string)
{
  int		ret;
  char		buf[4096 + 1];

  do {
    fprintf(stderr, "%s (Y/n) ? ", string);
  } while ((read(0, buf, 4096)) != 2 ||
	   (buf[0] != 'Y' && buf[0] != 'n'));
  return (buf[0] == 'Y' ? 1 : 0);
}
